﻿<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>关于江雷 About JiangLei</title>
    <link rel="stylesheet" type="text/css" href="style.css" />
    <style type="text/css">        
        .container p span
        {
            width: 70px;
            display: inline-table;
        }
        .container p .title
        {
			font-size:1.5em;
			display: inline;
        }
		.container p .expand
		{
			display:inline-table;
			width:85%;
		}		
		.container div
		{
			margin:30px 20px 0;
		}
		.myExper
		{
			font-size:1.8em;
			display:inline-block;
			line-height:36px;
			height:42px;
			width:956px;
			color:#FEFEFE;
			padding-left:25px;
			margin:5px 0 5px -28px;;
			background:url(images/exp.png) no-repeat;
		}
    </style>
</head>
<body>
    <div class="bodyDiv">
        <div class="header">
            <div class="imgB shadow">
                <img src="images/DSCN0319.jpg" alt="jl" class="pic" height="160" />
            </div>
            <p class="nav">
                <a href="AboutMe.html">动态版</a> | 静态版</p>
            <div class="info">
                <p class="name">
                    江雷 Jiang Lei</p>
                <p class="lable">
                    ITer &middot; Web前端 &middot; 摄影</p>
                <p>
                    <a href="www.whu.edu.cn">武汉大学</a> - <a href="http://www.iss.whu.edu.cn/">国际软件学院</a>
                    - <a href="http://www.iss.whu.edu.cn/detailForFixed.html?id=187">软件工程</a></p>
                <p>
                    <span>Email : </span><a href="mailto:jianglei.love.you@gmail.com">jianglei.love.you@gmail.com&nbsp;&#9993;</a></p>
            </div>
            <div class="clear">
            </div>
        </div>
        <div class="container" id="mainContent">
            <p class="myExper">
                我的经历</p>
        </div>
        <div class="footer">
            &copy;WHU-ISS-JiangLei-武汉大学-国际软件学院-江雷
        </div>
    </div>
    <script type="text/javascript">

        //XML文档相关变量
        var xmlUrl = "Work.xml"; //xml文件的路径
        var xmlDoc = loadXmlFile(xmlUrl); //加载xml
        var xmlWorkArr = xmlDoc.getElementsByTagName("Work");

        var N = xmlWorkArr.length; //N:有效信息的个数
        //加载xml文件
        function loadXmlFile(xmlUrl) {
            xmlDoc = null;
            try//IE
        {
                xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
                xmldoc.async = false; //必须同步
                xmlDoc.load(xmlUrl);
            }
            catch (e) {
                try//other Explorer
            {
                    xmlDoc = document.implementation.createDocument("", "", null);
                    try {
                        var xmlhttp = new window.XMLHttpRequest();
                        xmlhttp.open("GET", xmlUrl, false); //必须同步
                        xmlhttp.send(null);
                        xmlDoc = xmlhttp.responseXML;
                    }
                    catch (e) { alert(e.message) }
                }
                catch (e) { alert(e.message) }
            }
            return xmlDoc;
        }
        //写信息
        function writeInfo(xmlWorkArr, i) {
            var txt = "";
            var work = xmlWorkArr[i]
            if (work.getElementsByTagName("Work_Name")[0].childNodes[0] != null) {
                txt += '<div><p><span class="expand"><span class="title">&#10000;&nbsp;' + work.getElementsByTagName("Work_Name")[0].childNodes[0].nodeValue + '</span>&nbsp;&nbsp;&nbsp;';
            }
            if (work.getElementsByTagName("Work_Time")[0].childNodes[0] != null) {
                txt += work.getElementsByTagName("Work_Time")[0].childNodes[0].nodeValue + '</span><p/>';
            }
            if (work.getElementsByTagName("Work_Org")[0].childNodes[0] != null) {
                txt += '<p><span>机构:</span><span class="expand">' + work.getElementsByTagName("Work_Org")[0].childNodes[0].nodeValue + '</span><p/>';
            }
            if (work.getElementsByTagName("Work_Dscrp")[0].childNodes[0] != null) {
                txt += '<p><span>描述:</span><span class="expand">' + work.getElementsByTagName("Work_Dscrp")[0].childNodes[0].nodeValue + '</span><p/>';
            }
            if (work.getElementsByTagName("Work_Rspns")[0].childNodes[0] != null) {
                txt += '<p><span>负责:</span><span class="expand">' + work.getElementsByTagName("Work_Rspns")[0].childNodes[0].nodeValue + '</span><p/>';
            }
            if (work.getElementsByTagName("Work_Skill")[0].childNodes[0] != null) {
                txt += '<p><span>编程语言:</span><span class="expand">' + work.getElementsByTagName("Work_Skill")[0].childNodes[0].nodeValue + '</span><p/>';
            }
            if (work.getElementsByTagName("Work_Link")[0].childNodes[0] != null) {
                var linkNode = work.getElementsByTagName("Work_Link")[0].getElementsByTagName("Work_Link_Li");
                var len = linkNode.length, textBuf = "";

                for (var i = 0; i < len; i++) {
                    textBuf += '<a href=' + linkNode[i].childNodes[0].nodeValue + ' target="_blank">' +
					linkNode[i].getElementsByTagName("Work_Link_Li_Text")[0].childNodes[0].nodeValue + '</a>	'
                }
                txt += '<p><span>相关链接:</span><span class="expand">' + textBuf + '</span><p/>';
            }
            if (work.getElementsByTagName("Work_Award")[0].childNodes[0] != null) {
                txt += '<p><span>奖励:</span><span class="expand">' + work.getElementsByTagName("Work_Award")[0].childNodes[0].nodeValue + '</span><p/></div>';
            }
            return txt + '<hr>';
        }

        function writeAll(xmlWorkArr) {
            var content = document.getElementById('mainContent');
            for (var i = 0; i < N; i++) {
                content.innerHTML += writeInfo(xmlWorkArr, i);
            }
        }
        window.onload = writeAll(xmlWorkArr);
    </script>
</body>
</html>
